<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\utils\XHtml;

/* @var $this yii\web\View */
/* @var $model common\models\Article */

$this->title = $model->isNewRecord ? '新建幻灯片' : '更新幻灯片';
$this->params['breadcrumbs'][] = ['label' => '幻灯片管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-create">
    <div class="box box-primary">
        <div class="box-body">

            <?= $this->render('/site/error-summary', ['model' => $model]) ?>

            <?php $form = ActiveForm::begin([
                'options' => ['class' => 'form-horizontal'],
                'fieldConfig' => [
                    'template' => "{label}\n<div class=\"col-sm-6\">{input}</div>\n<div class=\"col-sm-4\">{hint}\n{error}</div>",
                    'labelOptions' => ['class ' => 'col-sm-2 control-label'],
                ]
            ]); ?>
            <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <?= XHtml::submitButton($model->isNewRecord ? '创建' : '更新') ?>&nbsp;&nbsp;
                <?= XHtml::backButton() ?>&nbsp;&nbsp;
                <?= XHtml::resetButton() ?>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>